import { proListApi } from "@/api/index.js";

const projectModule = {
  namespaced: true,
  state: {
    tableData: [],
  },
  mutations: {
    getList(state, payload) {
      state.tableData = payload.data;
      // state.total = payload.total;
    },
  },
  actions: {
    asyncGetList({ commit }, payload) {
      return new Promise(async (resolve) => {
        const res = await proListApi({
          count: payload.currentPage,
          limitNum: payload.pageSize,
        });
        commit("getList", res);
        resolve(res.total);
      });
    },
  },
};

export default projectModule;
